<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/index.css">
</head>

<body>
    <div class="box">
        <div class="herade">
            <ul class="hder-ul row">
                <li class="list active">关注</li>
                <li class="list">推荐</li>
                <li class="list">热榜</li>
                <li class="list">视频</li>
            </ul>
        </div>
        <div class="none-counter row">

            <div class="box2  activebox2">
                <div class="counter">
                    <div class="text-hed">
                        <p>就发哈金发红发i婚纱大户i导航~<span class="itme">10</span>天前</p>
                    </div>
                    <div class="h3-h">
                        <p>jhafkshafjkashfjka </p>
                    </div>
                    <div class="h3-p">
                        <p>大把大把好的哈德哈卡觉得看哈就宽松的环境</p>
                    </div>
                    <div class="foot row">
                        <div class="btn-ft row">
                            <div class="btn">
                                <i class="icon">?</i>赞同 5
                            </div>
                            <div class="jiantou">
                                <i class="icon">?</i>
                            </div>
                        </div>

                        <ul class="ullist row">
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                        </ul>
                    </div>
                </div>
                <div class="footer">
                    <p>发哈康活佛撒酒疯教案课件记得哈会计师</p>
                </div>
            </div>

            <div class="box2">
                <div class="counter">
                    <div class="text-hed">
                        <p>倒萨的哈萨克记得哈加达圣诞卡~<span class="itme">10</span>天前</p>
                    </div>
                    <div class="h3-h">
                        <p>艾迪康把电话吧活动巴萨快点哈空间</p>
                    </div>
                    <div class="h3-p">
                        <p>年后大大姐啊开始加大环境搭建撒看见反函数卡开发哈吉</p>
                    </div>
                    <div class="foot row">
                        <div class="btn-ft row">
                            <div class="btn">
                                <i class="icon">?</i>赞同 5
                            </div>
                            <div class="jiantou">
                                <i class="icon">?</i>
                            </div>
                        </div>

                        <ul class="ullist row">
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                        </ul>
                    </div>
                </div>
                <div class="footer">
                    <p>发哈康活佛撒酒疯教案课件记得哈会计师</p>
                </div>
            </div>

            <div class="box2">
                <div class="counter">
                    <div class="text-hed">
                        <p>就发哈金发红发i婚纱大户i导航~<span class="itme">10</span>天前</p>
                    </div>
                    <div class="h3-h">
                        <p>啊快点哈世界大会看得见啊好的卡就和大家</p>
                    </div>
                    <div class="h3-p">
                        <p>年后大大姐啊开始加大环境搭建撒看见反函数卡开发哈吉</p>
                    </div>
                    <div class="foot row">
                        <div class="btn-ft row">
                            <div class="btn">
                                <i class="icon">?</i>赞同 5
                            </div>
                            <div class="jiantou">
                                <i class="icon">?</i>
                            </div>
                        </div>

                        <ul class="ullist row">
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                        </ul>
                    </div>
                </div>
                <div class="footer">
                    <p>发哈康活佛撒酒疯教案课件记得哈会计师</p>
                </div>
            </div>

            <div class="box2">
                <div class="counter">
                    <div class="text-hed">
                        <p>就发哈金发红发i婚纱大户i导航~<span class="itme">10</span>天前</p>
                    </div>
                    <div class="h3-h">
                        <p>的撒可达八级的卡撒旦吉萨和第哦啊</p>
                    </div>
                    <div class="h3-p">
                        <p>不是大款大家都哈利的骄傲快乐到家啊</p>
                    </div>
                    <div class="foot row">
                        <div class="btn-ft row">
                            <div class="btn">
                                <i class="icon">?</i>赞同 5
                            </div>
                            <div class="jiantou">
                                <i class="icon">?</i>
                            </div>
                        </div>

                        <ul class="ullist row">
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                            <li><a href="#"><i class="tb">?</i>10条评论</a></li>
                        </ul>
                    </div>
                </div>
                <div class="footer">
                    <p>发哈康活佛撒酒疯教案课件记得哈会计师</p>
                </div>
            </div>

        </div>

    </div>


    <script>

        // 获取所有的标题元素
        let li = document.querySelectorAll('.list')
        let box2s = document.querySelectorAll('.none-counter .box2')

        li.forEach((item, index) => {
            item.addEventListener('click', function (e) {
                // console.log(e.target);
                document.querySelector('.hder-ul .active').classList.remove('active')
                e.target.classList.add('active')
                document.querySelector('.none-counter .activebox2').classList.remove('activebox2')
                box2s[index].classList.add('activebox2')
            })

        })

        // a.forEach(item => {
        //     item.addEventListener('click', function (e) {
        //         // console.log(e.target);
        //         a.forEach(item => {
        //             item.classList.remove('active')
        //         })
        //         item.classList.add('active')
        //     })
        // });
        // // 为每个标题添加点击事件
        // li.forEach(function (title, index) {
        //     title.addEventListener('click', function () {
        //         // 首先隐藏内容
        //         let box2 = document.querySelectorAll('.box2');
        //         box2.forEach(function (box2) {
        //             box2.style.display = 'none';
        //         });
        //         // 显示被点击标题后面紧跟的内容区域
        //         box2[index].style.display = 'block';
        //     });
        // });


    </script>
</body>

</html>